/*  Copyright 2010 Daniel Brasil Magnani
 *  Created on: Dec 20, 2010
 *      Author: daniel
 */

#ifndef CSP_CONSTRUCTIVE_H_
#define CSP_CONSTRUCTIVE_H_

#include <vector>
#include "instance.h"

class Constructive {
 public:
  // Get method for the solution.
  std::vector<Car> get_solution();

  // Initialize the solution.
  Constructive();

  // Execute the constructive heuristic.
  int Execute();

 private:
  // Create/Update the counter_vector_ used by the constructive heuristic.
  void CounterVector(std::vector<int> *cost_counter);

  // Create/Update the utilization_rate_ vector.
  void UtilizationRate(std::vector<Car> *S);

  // Retrieve the cost of the insertion of the car in the last position
  // of the sequence.
  int CostFrontInsert(const std::vector<int> &cost_counter,
                      const Car temp_car);

  // Vector that stores the sum of utilization rates for each car on the
  // solution
  std::vector<float> utilization_rate_;
  std::vector<Car> solution_;
  int solution_size_;
  int constraint_size_;
  int yesterday_size_;
};

#endif  // CSP_CONSTRUCTIVE_H_
